package com.shaoshaohuo.app.net;

import com.google.gson.Gson;
import com.lidroid.xutils.http.RequestParams;
import com.shaoshaohuo.app.SshApplication;
import com.shaoshaohuo.app.constant.AppConfig;
import com.shaoshaohuo.app.entity.Address;
import com.shaoshaohuo.app.entity.EditPurchasePublished;
import com.shaoshaohuo.app.entity.EditSupplyPublished;
import com.shaoshaohuo.app.entity.brandscope.BrandScope;
import com.shaoshaohuo.app.entity.cart.EcCartOrder;
import com.shaoshaohuo.app.entity.post.BusinessPublish;
import com.shaoshaohuo.app.entity.post.CarInfo;
import com.shaoshaohuo.app.entity.post.PurchasePublished;
import com.shaoshaohuo.app.entity.post.PurchaseQuote;
import com.shaoshaohuo.app.entity.post.SendGoodsEditEntity;
import com.shaoshaohuo.app.entity.post.SendGoodsEntity;
import com.shaoshaohuo.app.entity.post.SupplyOrderAdd;
import com.shaoshaohuo.app.entity.post.SupplyPublished;
import com.shaoshaohuo.app.framework.Logger;
import com.shaoshaohuo.app.framework.SharedPreferencesHelper;
import com.shaoshaohuo.app.framework.SharedPreferencesHelper.Field;
import com.shaoshaohuo.app.utils.DeviceHelper;
import com.shaoshaohuo.app.utils.DeviceUuidFactory;
import com.shaoshaohuo.app.utils.StringHelper;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 封装参数 Created by yusonglin on 2015/7/9. Description:
 */
public class RequestParam {

    /**
     * @param isNeedToken
     * @param paramsMap
     * @return add common params. or sign.
     */
    private static Map<String, String> getBaseParams(boolean isNeedToken, Map<String, String> paramsMap) {
        // if (isNeedToken) {
        // String token = AccountManager.getAuthToken();
        // paramsMap.put(Params.token, token);
        // }
        // // TODO ...add common params
        // String sign = getSignToken(paramsMap);
        // paramsMap.put(Params.sign, sign);
        return paramsMap;
    }

    private static String getSignToken(Map<String, String> paramsMap) {
        StringBuilder builder = new StringBuilder();
        Set<String> keySet = paramsMap.keySet();
        List<String> keyList = new ArrayList<>();
        for (String key : keySet) {
            keyList.add(key);
        }
        Collections.sort(keyList, new Comparator<String>() {

            @Override
            public int compare(String lhs, String rhs) {
                return lhs.compareTo(rhs);
            }
        });
        for (String key : keyList) {
            builder.append(key).append(paramsMap.get(key));
        }
        builder.append(HttpConfig.KEY_REQUEST);
        Logger.d1("checkToken", builder.toString());
        String sign = StringHelper.toMD5(builder.toString());
        Logger.d1("Sign-toMD5", sign);
        return sign;
    }

    // UserAgent? string 是 取值 android、iphone
    // channelId string 是 客户端版本绑定: appstore, 360等
    // productId string 是 客户端版本绑定:
    // deviceId string 是 设备唯一ID
    // userId string 否 当前用户的id
    // userToken string 否 用户登录验证授权
    public static Map<String, String> getHeaderParams() {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.UserAgent, HttpConfig.USER_AGENT);
        paramsMap.put(Params.channelId, "android");
        paramsMap.put(Params.productId, DeviceHelper.getVersionCode(SshApplication.getContext()) + "");
        paramsMap.put(Params.deviceId, new DeviceUuidFactory(SshApplication.getContext()).getDeviceUuid().toString());
        paramsMap.put(Params.userId, SharedPreferencesHelper.getString(Field.USER_ID, ""));
//        paramsMap.put(Params.userId, "32237");
        paramsMap.put(Params.userToken, SharedPreferencesHelper.getString(Field.USER_TOKEN, ""));
//        paramsMap.put(Params.userToken, "d99duJgC6uyZsqvLK4abD3H%2BKqHIcni%2FylO9Hn5kBE7AhJ2goQg6a4aRpm%2BNCWwgie3rmalwygxPpxacX3BL88VD0DADuC2IXJLGPkQ7vIy%2BVRkaglXmMf6CLZ2JXfYuSPc2AEDnuNPF0BVanvbMb8kLKX4yBQT%2Fh6ZtF4ocqEhbdCEDnBoHp3HvyTNomYPurxT8ccs6T2aZZe84wshnkcFTw6hCfR%2BUzE0xMHMd7uggt7XB%2FUuezUYW7f1ETD6K4aDjqvBCMgDzW53X%2BMIw3xbEXvfEc%2FwWe54EowS2PmkKXtvVEWxvkvrboBSf5Q%2F8y2AQFeSbmrkzcYKtdwiqy4CucpTh%2F5D2PehpyMssJVq5JPQzU4MrWxsSf0%2B%2FkGcT3J4atV2bkpFrAq1%2B");
        paramsMap.put(Params.appid, AppConfig.getRoleId() + "");
        return getBaseParams(false, paramsMap);
    }

    public static void setHeaderParams(RequestParams params) {
        params.addHeader(Params.UserAgent, HttpConfig.USER_AGENT);
        params.addHeader(Params.channelId, "android");
        params.addHeader(Params.productId, DeviceHelper.getVersionCode(SshApplication.getContext()) + "");
        params.addHeader(Params.deviceId,
                new DeviceUuidFactory(SshApplication.getContext()).getDeviceUuid().toString());
        params.addHeader(Params.userId, SharedPreferencesHelper.getString(Field.USER_ID, ""));
        params.addHeader(Params.userToken, SharedPreferencesHelper.getString(Field.USER_TOKEN, ""));
        params.addHeader(Params.appid, AppConfig.getRoleId() + "");
    }

    public static Map<String, String> getLoginParams(String mobile, String smscode, String investCode) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.mobile, mobile);
        paramsMap.put(Params.smscode, smscode);
        paramsMap.put(Params.investCode, investCode);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getDefaultParams() {
        Map<String, String> paramsMap = new HashMap<>();
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getLoginSmsParams(String mobile) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.mobile, mobile);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getAddAddressParams(String cityid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cityid, cityid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getUserInfoParams(String userid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.userid, userid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSaveBaseInfoParams(String avatar, String realname, String mIdnum,
                                                            String gender, String birthday, String idphoto1, String idphoto2, String addressCityId) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.avatar, avatar);
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.idnum, mIdnum);
        paramsMap.put(Params.gender, gender);
        paramsMap.put(Params.birthday, birthday);
        paramsMap.put(Params.idphoto1, idphoto1);
        paramsMap.put(Params.idphoto2, idphoto2);
        paramsMap.put(Params.addressCityId, addressCityId);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getDeleteResideParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSaveLineParams(String fromcityid, String tocityid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.fromcityid, fromcityid);
        paramsMap.put(Params.tocityid, tocityid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSaveCarParams(CarInfo info) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, info.getId());
        paramsMap.put(Params.cartype, info.getCartype());
        paramsMap.put(Params.carcid, info.getCarcid());
        paramsMap.put(Params.carphoto1, info.getCarphoto1());
        paramsMap.put(Params.carphoto2, info.getCarphoto2());
        paramsMap.put(Params.carphoto3, info.getCarphoto3());
        paramsMap.put(Params.carnum, info.getCarnum());
        paramsMap.put(Params.caryear, info.getCaryear());
        paramsMap.put(Params.cardriverimg, info.getCardriverimg());
        paramsMap.put(Params.carlong, info.getCarlong());
        paramsMap.put(Params.carwidth, info.getCarwidth());
        paramsMap.put(Params.carheight, info.getCarheight());
        paramsMap.put(Params.carweight, info.getCarweight());
        paramsMap.put(Params.carcubage, info.getCarcubage());
        paramsMap.put(Params.triptype, info.getTriptype());
        Gson gson = new Gson();
        String often_route = gson.toJson(info.getOften_route());
        paramsMap.put(Params.often_route, often_route);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSeedsGoodsParams(SendGoodsEntity info) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.origincityid, info.getOrigincityid());
        paramsMap.put(Params.originaddress, info.getOriginaddress());
        paramsMap.put(Params.originlng, info.getOriginlng());
        paramsMap.put(Params.originlat, info.getOriginlat());
        paramsMap.put(Params.origintime, info.getOrigintime());
        paramsMap.put(Params.origincontact, info.getOrigincontact());
        paramsMap.put(Params.originphone, info.getOriginphone());
        paramsMap.put(Params.receivecityid, info.getReceivecityid());
        paramsMap.put(Params.receiveaddress, info.getReceiveaddress());
        paramsMap.put(Params.receivelng, info.getReceivelng());
        paramsMap.put(Params.receivelat, info.getReceivelat());
        paramsMap.put(Params.receivetime, info.getReceivetime());
        paramsMap.put(Params.cartype, info.getCartype());
        paramsMap.put(Params.carcid, info.getCarcid());
        paramsMap.put(Params.carlength, info.getCarlength());
        paramsMap.put(Params.carweight, info.getCarweight());
        paramsMap.put(Params.shipptype, info.getShipptype());
        paramsMap.put(Params.shippimgs, info.getShippimgs());
        paramsMap.put(Params.shippweight, info.getShippweight());
        paramsMap.put(Params.shipparea, info.getShipparea());
        paramsMap.put(Params.shipplength, info.getShipplength());
        paramsMap.put(Params.attachs, info.getAttachs());
        paramsMap.put(Params.mark, info.getMark());
        paramsMap.put(Params.bxprice, info.getBxprice());
        paramsMap.put(Params.bxnum, info.getBxnum());
        paramsMap.put(Params.voice, info.getVoice());
        paramsMap.put(Params.voicetime, info.getVoicetime());
        paramsMap.put(Params.payment, info.getPayment());
        paramsMap.put(Params.ordername, info.getOrdername());
        paramsMap.put(Params.businessorderid, info.getBusinessorderid());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEditSeedsGoodsParams(SendGoodsEditEntity info) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, info.getId());
        paramsMap.put(Params.orderid, info.getBusinessorderid());
        paramsMap.put(Params.origincityid, info.getOrigincityid());
        paramsMap.put(Params.originaddress, info.getOriginaddress());
        paramsMap.put(Params.originlng, info.getOriginlng());
        paramsMap.put(Params.originlat, info.getOriginlat());
        paramsMap.put(Params.origintime, info.getOrigintime());
        paramsMap.put(Params.origincontact, info.getOrigincontact());
        paramsMap.put(Params.originphone, info.getOriginphone());
        paramsMap.put(Params.receivecityid, info.getReceivecityid());
        paramsMap.put(Params.receiveaddress, info.getReceiveaddress());
        paramsMap.put(Params.receivelng, info.getReceivelng());
        paramsMap.put(Params.receivelat, info.getReceivelat());
        paramsMap.put(Params.receivetime, info.getReceivetime());
        paramsMap.put(Params.cartype, info.getCartype());
        paramsMap.put(Params.carcid, info.getCarcid());
        paramsMap.put(Params.carlength, info.getCarlength());
        paramsMap.put(Params.carweight, info.getCarweight());
        paramsMap.put(Params.shipptype, info.getShipptype());
        paramsMap.put(Params.shippimgs, info.getShippimgs());
        paramsMap.put(Params.shippweight, info.getShippweight());
        paramsMap.put(Params.shipparea, info.getShipparea());
        paramsMap.put(Params.shipplength, info.getShipplength());
        paramsMap.put(Params.attachs, info.getAttachs());
        paramsMap.put(Params.mark, info.getMark());
        paramsMap.put(Params.bxprice, info.getBxprice());
        paramsMap.put(Params.bxnum, info.getBxnum());
        paramsMap.put(Params.voice, info.getVoice());
        paramsMap.put(Params.voicetime, info.getVoicetime());
        paramsMap.put(Params.payment, info.getPayment());
        paramsMap.put(Params.ordername, info.getOrdername());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getCargoOrderParams(String size, String cursor, String action,
                                                          String searchstatus) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.searchstatus, searchstatus);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getCargoOrderDetailParams(String orderid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.lat, SharedPreferencesHelper.getString(SharedPreferencesHelper.Field.LAT, ""));
        paramsMap.put(Params.lng, SharedPreferencesHelper.getString(SharedPreferencesHelper.Field.LNG, ""));
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPayParams(String orderid, String paykey, String passwd, String money,
                                                   String couponid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.paykey, paykey);
        paramsMap.put(Params.passwd, passwd);
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.couponid, couponid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getOperateParams(String orderid, String typeid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.typeid, typeid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getGrabOrderParams(String orderid, String money) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.money, money);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSearchCargoParams(String action, String size, String cursor, String lng,
                                                           String lat, String shipptype, String ranktype, String origincityid, String receivecityid, boolean isMap) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.lng, lng);
        paramsMap.put(Params.lat, lat);
        paramsMap.put(Params.shipptype, shipptype);
        paramsMap.put(Params.ranktype, ranktype);
        paramsMap.put(Params.origincityid, origincityid);
        paramsMap.put(Params.receivecityid, receivecityid);
        if (isMap) {
            paramsMap.put(Params.source, "map");
        }
        return getBaseParams(false, paramsMap);
    }

    // --------------------

    public static Map<String, String> getMessageListParams(String size, String cursor, String action, String type) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.type, type);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getRemindParams(String orderid, String tipstype) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.tipstype, tipstype);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getProcessParams(String orderid, String handleStatus) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.handleStatus, handleStatus);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSelectDriverParams(String orderid, String caruserid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.caruserid, caruserid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPayParams(String orderid, String paykey, String passwd, String money,
                                                   String couponid, String origincontact, String originphone, String bxprice, String bxnum) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.paykey, paykey);
        paramsMap.put(Params.passwd, passwd);
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.couponid, couponid);
        paramsMap.put(Params.origincontact, origincontact);
        paramsMap.put(Params.originphone, originphone);
        paramsMap.put(Params.bxprice, bxprice);
        paramsMap.put(Params.bxnum, bxnum);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEvaluationParams(String orderid, String content, String startnum) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.content, content);
        paramsMap.put(Params.startnum, startnum);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEvaluationEcParams(String orderid, String content, String typeid,
                                                            String startnum) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.content, content);
        paramsMap.put(Params.typeid, typeid);
        paramsMap.put(Params.startnum, startnum);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEvaluationListParams(String userid, String orderid, String dtype, String size, String cursor,
                                                              String action) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.userid, userid);
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.dtype, dtype);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSearchCarParams(String action, String size, String cursor, String lng,
                                                         String lat, String cartype, String carcid, String longoption, String weightoption,
                                                         String origincityid, String receivecityid, String triptype) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.lng, lng);
        paramsMap.put(Params.lat, lat);
        paramsMap.put(Params.cartype, cartype);
        paramsMap.put(Params.carcid, carcid);
        paramsMap.put(Params.longoption, longoption);
        paramsMap.put(Params.weightoption, weightoption);
        paramsMap.put(Params.origincityid, origincityid);
        paramsMap.put(Params.receivecityid, receivecityid);
        paramsMap.put(Params.triptype, triptype);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getReportGeoParams(String lng, String lat) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.lng, lng);
        paramsMap.put(Params.lat, lat);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getMainIndex(String newssize) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.newssize, newssize);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getCouponParams(String size, String action, String cursor, String status) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.status, status);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPayFlowParams(String cursor, String offset, String typeid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.typeid, typeid);
        paramsMap.put(Params.cursor, cursor);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPointListParams(String size, String action, String cursor) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPointGoodsDetailParams(String goodsid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.goodsid, goodsid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getExchangeGoodsParams(String goodsid, String num, String contact, String phone,
                                                             String address) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.goodsid, goodsid);
        paramsMap.put(Params.num, num);
        paramsMap.put(Params.contact, contact);
        paramsMap.put(Params.phone, phone);
        paramsMap.put(Params.address, address);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getWithdrawParams(String id, String account, String realname, String idnum,
                                                        String money, String code) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.account, account);
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.idnum, idnum);
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.code, code);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getRechangeParams(String money, String paykey) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.paykey, paykey);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getResetPwdParams(String passwd, String newpasswd) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.passwd, passwd);
        paramsMap.put(Params.newpasswd, newpasswd);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getForgotPwdParams(String code, String passwd) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.code, code);
        paramsMap.put(Params.passwd, passwd);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getFeedbackParams(String content) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.content, content);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getNewsListParams(String cursor, String size, String action, String catid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.catid, catid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getToolsParams(String newssize, String cityid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.newssize, newssize);
        paramsMap.put(Params.cityid, cityid);
        return getBaseParams(false, paramsMap);
    }


    public static Map<String, String> getSeedsGoodsByCarParams(SendGoodsEntity info) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.money, info.getMoney());
        paramsMap.put(Params.caruserid, info.getCaruserid());
        paramsMap.put(Params.origincityid, info.getOrigincityid());
        paramsMap.put(Params.originaddress, info.getOriginaddress());
        paramsMap.put(Params.originlng, info.getOriginlng());
        paramsMap.put(Params.originlat, info.getOriginlat());
        paramsMap.put(Params.origintime, info.getOrigintime());
        paramsMap.put(Params.origincontact, info.getOrigincontact());
        paramsMap.put(Params.originphone, info.getOriginphone());
        paramsMap.put(Params.receivecityid, info.getReceivecityid());
        paramsMap.put(Params.receiveaddress, info.getReceiveaddress());
        paramsMap.put(Params.receivelng, info.getReceivelng());
        paramsMap.put(Params.receivelat, info.getReceivelat());
        paramsMap.put(Params.receivetime, info.getReceivetime());
        paramsMap.put(Params.cartype, info.getCartype());
        paramsMap.put(Params.carcid, info.getCarcid());
        paramsMap.put(Params.carlength, info.getCarlength());
        paramsMap.put(Params.carweight, info.getCarweight());
        paramsMap.put(Params.shipptype, info.getShipptype());
        paramsMap.put(Params.shippimgs, info.getShippimgs());
        paramsMap.put(Params.shippweight, info.getShippweight());
        paramsMap.put(Params.shipparea, info.getShipparea());
        paramsMap.put(Params.attachs, info.getAttachs());
        paramsMap.put(Params.mark, info.getMark());
        paramsMap.put(Params.bxprice, info.getBxprice());
        paramsMap.put(Params.bxnum, info.getBxnum());
        paramsMap.put(Params.voice, info.getVoice());
        paramsMap.put(Params.voicetime, info.getVoicetime());
        paramsMap.put(Params.shipplength, info.getShipplength());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getCategoryVariety(String bigpid, String pid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEcMarketSearchParams(String cityid, String name) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cityid, cityid);
        paramsMap.put(Params.name, name);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSetRoleParams(String roleid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.roleid, roleid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSetRoleTypeParams(String roletype) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.roletype, roletype);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 我要买 旧接口
     */
    @Deprecated
    public static Map<String, String> getPurchasePublishedParams(PurchasePublished purchasePublished) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.title, purchasePublished.getTitle());
        paramsMap.put(Params.bigpid, purchasePublished.getBigpid());
        paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.catid, purchasePublished.getCatid());
        paramsMap.put(Params.varieties, purchasePublished.getVarieties());
        paramsMap.put(Params.productnot, purchasePublished.getProductnot());
        // paramsMap.put(Params.num, purchasePublished.getNum() + "");
        paramsMap.put(Params.num, purchasePublished.getNum());
        paramsMap.put(Params.start, purchasePublished.getStart());
        paramsMap.put(Params.end, purchasePublished.getEnd());
        paramsMap.put(Params.cityid, purchasePublished.getCityid());
        paramsMap.put(Params.address, purchasePublished.getAddress());
        paramsMap.put(Params.realname, purchasePublished.getRealname());
        paramsMap.put(Params.mobile, purchasePublished.getMobile());
        paramsMap.put(Params.content, purchasePublished.getContent());
        paramsMap.put(Params.marketproid, purchasePublished.getMarketproid());
        paramsMap.put(Params.marketcitycode, purchasePublished.getMarketcitycode());
        paramsMap.put(Params.marketid, purchasePublished.getMarketid());
        paramsMap.put(Params.position, purchasePublished.getPosition());
        paramsMap.put(Params.yearmoney, purchasePublished.getYearmoney());
        paramsMap.put(Params.unit, purchasePublished.getUnit());
        paramsMap.put(Params.lng, purchasePublished.getLng());
        paramsMap.put(Params.lat, purchasePublished.getLat());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyPublishParams(SupplyPublished purchasePublished) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.title, purchasePublished.getTitle());
        paramsMap.put(Params.bigpid, purchasePublished.getBigpid());
//		paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.moneyType, purchasePublished.getMoneyType());
        paramsMap.put(Params.catid, purchasePublished.getCatid());
        paramsMap.put(Params.productnot, purchasePublished.getProductnot());
        paramsMap.put(Params.start, purchasePublished.getStart());
        paramsMap.put(Params.end, purchasePublished.getEnd());
        paramsMap.put(Params.cityid, purchasePublished.getCityid());
        paramsMap.put(Params.address, purchasePublished.getAddress());
        paramsMap.put(Params.realname, purchasePublished.getRealname());
        paramsMap.put(Params.mobile, purchasePublished.getMobile());
        paramsMap.put(Params.content, purchasePublished.getContent());
        paramsMap.put(Params.unit, purchasePublished.getUnit());
        paramsMap.put(Params.lng, purchasePublished.getLng());
        paramsMap.put(Params.lat, purchasePublished.getLat());
        paramsMap.put(Params.minsell, purchasePublished.getMinsell());
        paramsMap.put(Params.images, purchasePublished.getImages());
        paramsMap.put(Params.shuai, purchasePublished.getShuai());
        paramsMap.put(Params.money, purchasePublished.getMoney());
        //1.4 新增参数  发布到商机
        paramsMap.put(Params.searchtxt, purchasePublished.getSearchtxt());
        paramsMap.put(Params.histroySupply, purchasePublished.getHistroySupply());
        paramsMap.put(Params.specifications, purchasePublished.getSpecifications());

        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPurchasePublishedListParams(String cursor, String size, String action) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.action, action);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyPublishListParams(String cursor, String offset, String action) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.action, action);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyPublishListParams(String cursor, String offset, String action,
                                                                 String bigpid, String pid, String catid, String cityid, String shuai) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        paramsMap.put(Params.catid, catid);
        paramsMap.put(Params.cityid, cityid);
        paramsMap.put(Params.shuai, shuai);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyPublishListParams(String cursor, String offset, String action,
                                                                 String bigpid, String pid, String catid, String cityid, String shuai, String brandScope) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        paramsMap.put(Params.catid, catid);
        paramsMap.put(Params.cityid, cityid);
        paramsMap.put(Params.shuai, shuai);
        paramsMap.put(Params.brandScope, brandScope);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getFindSellerListParams(String cursor, String offset, String action,
                                                              String bigpid, String pid, String catid, String cityid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        paramsMap.put(Params.catid, catid);
        paramsMap.put(Params.cityid, cityid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getBuyersListParams(String size, String cursor, String action, String cityid, String lng, String lat, String long1, String buyersize) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cityid, cityid);
        paramsMap.put(Params.lng, lng);
        paramsMap.put(Params.lat, lat);
        paramsMap.put(Params.long1, long1);
        paramsMap.put(Params.buyersize, buyersize);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyDetailParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getOrderDetailParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, id);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSupplyOrderAddParams(SupplyOrderAdd supplyOrder) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.supplyid, supplyOrder.getSupplyid());
        paramsMap.put(Params.num, supplyOrder.getNum());
        paramsMap.put(Params.receivecontact, supplyOrder.getReceivecontact());
        paramsMap.put(Params.recemobile, supplyOrder.getRecemobile());
        paramsMap.put(Params.receiveaddress, supplyOrder.getReceiveaddress());
        paramsMap.put(Params.receivecityid, supplyOrder.getReceivecityid());
        paramsMap.put(Params.receivelng, supplyOrder.getReceivelng());
        paramsMap.put(Params.receivelat, supplyOrder.getReceivelat());
        paramsMap.put(Params.receivetime, supplyOrder.getReceivetime());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEcPayOrderParams(String action, String orderid, String paykey, String passwd,
                                                          String money) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.orderid, orderid);
        paramsMap.put(Params.paykey, paykey);
        paramsMap.put(Params.passwd, passwd);
        paramsMap.put(Params.money, money);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEcSupplyOrderParams(String action, String cursor, String offset,
                                                             String status) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.status, status);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getEcPurchaseOrderParams(String status, String cursor, String size,
                                                               String action) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, size);
        paramsMap.put(Params.status, status);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getQuoteListParams(String orderid, String cursor, String size, String action) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, size);
        paramsMap.put(Params.orderid, orderid);
        return getBaseParams(false, paramsMap);
    }

    // string 是 采购ID
    // string 是 报价单价
    // string 是 联系人
    // string 是 联系电话
    // string 是 地址
    // string 是 供应上性质 0未知 1合作社 2养殖户 3加工企业
    // string 是 资质说明
    // string 是 土地使用方式 0未知 1自有 2租赁
    // string 是 农残外检周期 0未知 1三个月 2六个月 3一年 4随时 5无
    // string 是 生产日期
    // string 是 产品描述

    public static Map<String, String> getQuoteParams(PurchaseQuote purchaseQuote) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, purchaseQuote.getId());
        paramsMap.put(Params.price, purchaseQuote.getPrice());
        paramsMap.put(Params.realname, purchaseQuote.getRealname());
        paramsMap.put(Params.phone, purchaseQuote.getPhone());
        paramsMap.put(Params.originaddress, purchaseQuote.getOriginaddress());
        paramsMap.put(Params.gytype, purchaseQuote.getGytype());
        paramsMap.put(Params.note, purchaseQuote.getNote());
        paramsMap.put(Params.tdtype, purchaseQuote.getTdtype());
        paramsMap.put(Params.ncycle, purchaseQuote.getNcycle());
        paramsMap.put(Params.createdate, purchaseQuote.getCreatedate());
        paramsMap.put(Params.content, purchaseQuote.getContent());
        paramsMap.put(Params.mainproducts, purchaseQuote.getMainproducts());
        paramsMap.put(Params.supplylimit, purchaseQuote.getSupplylimit());
        paramsMap.put(Params.suppliers, purchaseQuote.getSuppliers());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getQuoteDetailParams(String id, String orderid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.orderid, orderid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getCancelSupplyOrderParams(String orderid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.orderid, orderid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getPurchaseListParams(String cursor, String size, String action, String bigpid,
                                                            String catid, String varieties, String cityid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.catid, catid);
        paramsMap.put(Params.varieties, varieties);
        paramsMap.put(Params.cityid, cityid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> findBuyersMore(String marketid, String buyersize, String cursor) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.marketid, marketid);
        paramsMap.put(Params.buyersize, buyersize);
        paramsMap.put(Params.cursor, cursor);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> saveBigCustomerInfo(String avatar, String realname, String mobile,
                                                          String license) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.avatar, avatar);
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.mobile, mobile);
        paramsMap.put(Params.license, license);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getBusinessPushlishedParams(BusinessPublish businessPublish) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cityid, businessPublish.getCityid());
        paramsMap.put(Params.lng, businessPublish.getLng());
        paramsMap.put(Params.lat, businessPublish.getLat());
        paramsMap.put(Params.bigpid, businessPublish.getBigpid());
        paramsMap.put(Params.pid, businessPublish.getPid());
        paramsMap.put(Params.catid, businessPublish.getCatid());
        paramsMap.put(Params.realname, businessPublish.getRealname());
        paramsMap.put(Params.mobile, businessPublish.getMobile());
        paramsMap.put(Params.unit, businessPublish.getUnit());
        paramsMap.put(Params.address, businessPublish.getAddress());
        paramsMap.put(Params.supplymarket, businessPublish.getSupplymarket());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> saveWarehouseInfo(String avatar, String realname, String mobile, String nickname,
                                                        String idphoto1, String idphoto2, String menlogo) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.avatar, avatar);
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.mobile, mobile);
        paramsMap.put(Params.nickname, nickname);
        paramsMap.put(Params.idphoto1, idphoto1);
        paramsMap.put(Params.idphoto2, idphoto2);
        paramsMap.put(Params.menlogo, menlogo);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getBusinessHistoryParams(String bigpid, String pid, String catid, String cityid,
                                                               String cursor, String action, String offset) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        paramsMap.put(Params.catid, catid);
        paramsMap.put(Params.cityid, cityid);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.offset, offset);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getMarketDetailParams(String marketid, String buyersize) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.marketid, marketid);
        paramsMap.put(Params.buyersize, buyersize);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSellerDetailParams(String id) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.id, id);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getSearchParams(String keyword, String size, String cursor, String action,
                                                      String typeid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.keyword, keyword);
        paramsMap.put(Params.size, size);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.typeid, typeid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getMyQuoteDetailParams(String supplyuserid, String orderid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.supplyuserid, supplyuserid);
        paramsMap.put(Params.orderid, orderid);
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> getRemindSupplyOrderParams(String orderid, String typeid) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.typeid, typeid);
        paramsMap.put(Params.orderid, orderid);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 浏览记录
     */
    public static Map<String, String> getBrowseRecordParams(String count) {
        Map<String, String> paramsMap = new HashMap<>();
        // Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.count, count);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 行情列表
     */
    public static Map<String, String> getMarketPriceParams(String type, String action, String cursor, String offset,
                                                           String addressCode, String levelType, String bigName) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.type, type);
        paramsMap.put(Params.action, action);
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.addressCode, addressCode);
        paramsMap.put(Params.levelType, levelType);
        paramsMap.put(Params.bigName, bigName);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 电商首页今日行情
     */
    public static Map<String, String> getMarketConditionParams(String type) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.type, type);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 常用收货地址 增加收获地址
     */
    public static Map<String, String> getAddAddressParams(Address address) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.receiverName, address.getReceiver_name());
        paramsMap.put(Params.cityid, address.getId());
        paramsMap.put(Params.address, address.getAddress());
        paramsMap.put(Params.receiverPhone, address.getReceiver_phone());
        paramsMap.put(Params.defaul, address.getIs_default());
        return getBaseParams(false, paramsMap);
    }

    /**
     * 删除收获地址
     */
    public static Map<String, String> getDeleteAddressParams(String ids) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.ids, ids);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 设置默认收货地址
     */
    public static Map<String, String> getSetDefaultAddressParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 支付详情
     */
    public static Map<String, String> getIncomeStatement(String cursor, String typeid, String offset, String month) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.typeid, typeid);
        paramsMap.put(Params.offset, offset);
        paramsMap.put(Params.month, month);
        return getBaseParams(false, paramsMap);
    }

    /**
     * 用户签到
     */
    public static Map<String, String> getUserSign() {
        Map<String, String> paramsMap = new HashMap<>();
        return getBaseParams(false, paramsMap);
    }

    /**
     * 电商下单，同时支持直接下单与购物车下单
     */
    public static Map<String, String> getSaveEcCartOrderParams(EcCartOrder cartOrder) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.ids, cartOrder.getIds());
        paramsMap.put(Params.units, cartOrder.getUnits());
        paramsMap.put(Params.quantitys, cartOrder.getQuantitys());
        paramsMap.put(Params.receivingaddressid, cartOrder.getReceivingaddressid());
        return paramsMap;
    }

    /**
     * 我要买  接口
     */
    public static Map<String, String> getPurchasePublishedMoreParams(PurchasePublished purchasePublished) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.title, purchasePublished.getTitle());
        paramsMap.put(Params.bigpid, purchasePublished.getBigpid());
        paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.catid, purchasePublished.getCatid());
        paramsMap.put(Params.varieties, purchasePublished.getVarieties());
        paramsMap.put(Params.productnot, purchasePublished.getProductnot());
        // paramsMap.put(Params.num, purchasePublished.getNum() + "");
        paramsMap.put(Params.num, purchasePublished.getNum());
        paramsMap.put(Params.start, purchasePublished.getStart());
        paramsMap.put(Params.end, purchasePublished.getEnd());
        paramsMap.put(Params.addressId, purchasePublished.getAddressId());
        paramsMap.put(Params.content, purchasePublished.getContent());
        paramsMap.put(Params.marketcityid, purchasePublished.getMarketcityid());
        paramsMap.put(Params.marketid, purchasePublished.getMarketid());
        paramsMap.put(Params.position, purchasePublished.getPosition());
        paramsMap.put(Params.yearmoney, purchasePublished.getYearmoney());
        paramsMap.put(Params.unit, purchasePublished.getUnit());
        paramsMap.put(Params.lng, purchasePublished.getLng());
        paramsMap.put(Params.lat, purchasePublished.getLat());
        paramsMap.put(Params.specifications, purchasePublished.getSpecifications());
        return getBaseParams(false, paramsMap);
    }


    /**
     * 添加到购物车
     *
     * @param goods_id
     * @return
     */
    public static Map<String, String> getAddGoodsToEcCartParams(String goods_id) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.goods_id, goods_id);
        return paramsMap;
    }

    /**
     * 从购物车删除商品
     *
     * @param goodsId 商品id
     * @return
     */
    public static Map<String, String> getDeleteFromEcCartParams(String goodsId) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.goods_id, goodsId);
        return paramsMap;
    }

    /**
     * 检查版本更新
     *
     * @param versionName
     * @return
     */
    public static Map<String, String> getCheckVersionParams(String versionName) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.client_version, versionName);
        return paramsMap;
    }

    /**
     * 绑定银行卡
     */
    public static Map<String, String> getAddPayAccountParams(String id, String account, String realname, String mobile, String subbranch) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.account, account);
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.mobile, mobile);
        paramsMap.put(Params.subbranch, subbranch);
        return paramsMap;
    }

    /**
     * 删除银行卡
     */
    public static Map<String, String> getDeletePayAccountParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        return paramsMap;
    }

    /**
     * 设置默认银行卡
     */
    public static Map<String, String> getSetDefaultAccountParams(String id) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        return paramsMap;
    }

    /**
     * 银行卡列表
     */
    public static Map<String, String> getPayAccountListParams(String isDefault) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.isDefault, isDefault);
        return paramsMap;
    }

    /**
     * 通过绑定的银行卡提现
     */
    public static Map<String, String> getApplyForAccountParams(String id, String money, String code) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.code, code);
        return paramsMap;
    }

    public static Map<String, String> publishedGoodsList(String cursor, String offset) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        return paramsMap;
    }

    public static Map<String, String> publishedGoodsListDelete(String id) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.id, id);
        return paramsMap;
    }

    public static Map<String, String> publishedGoodsListRefresh(String id) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.id, id);
        return paramsMap;
    }

    public static Map<String, String> publishedPurchaseRecordRefresh(String number) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.number, number);
        return paramsMap;
    }

    public static Map<String, String> getEditPurchaseRecordParams(EditPurchasePublished entity) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.number, entity.getNumber());
        paramsMap.put(Params.title, entity.getTitle());
        paramsMap.put(Params.bigpid, entity.getBigpid());
        paramsMap.put(Params.pid, entity.getPid());
        paramsMap.put(Params.catid, entity.getCatid());
        paramsMap.put(Params.varieties, entity.getVarieties());
//		paramsMap.put(Params.productnot, entity.getProductnot());
        // paramsMap.put(Params.num, purchasePublished.getNum() + "");
        paramsMap.put(Params.num, entity.getNum());
        paramsMap.put(Params.start, entity.getStart());
        paramsMap.put(Params.end, entity.getEnd());
        paramsMap.put(Params.addressId, entity.getAddressId());
        paramsMap.put(Params.content, entity.getContent());
        paramsMap.put(Params.marketcityid, entity.getMarketcityid());
        paramsMap.put(Params.marketid, entity.getMarketid());
        paramsMap.put(Params.position, entity.getPosition());
        paramsMap.put(Params.yearmoney, entity.getYearmoney());
        paramsMap.put(Params.unit, entity.getUnit());
        paramsMap.put(Params.lng, entity.getLng());
        paramsMap.put(Params.lat, entity.getLat());
        paramsMap.put(Params.specifications, entity.getSpecifications());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> publishedPurchaseRecordDelete(String number) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.number, number);
        return paramsMap;
    }

    public static Map<String, String> publishedSupplyRecordRefresh(String number) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.number, number);
        return paramsMap;
    }

    public static Map<String, String> getEditSupplyRecordParams(EditSupplyPublished purchasePublished) {
        Map<String, String> paramsMap = new HashMap<>();
        paramsMap.put(Params.number, purchasePublished.getNumber());
        paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.title, purchasePublished.getTitle());
        paramsMap.put(Params.bigpid, purchasePublished.getBigpid());
        paramsMap.put(Params.moneyType, purchasePublished.getMoneyType());
//		paramsMap.put(Params.pid, purchasePublished.getPid());
        paramsMap.put(Params.catid, purchasePublished.getCatid());
//		paramsMap.put(Params.productnot, purchasePublished.getProductnot());
        paramsMap.put(Params.start, purchasePublished.getStart());
        paramsMap.put(Params.end, purchasePublished.getEnd());
        paramsMap.put(Params.cityid, purchasePublished.getCityid());
        paramsMap.put(Params.address, purchasePublished.getAddress());
        paramsMap.put(Params.realname, purchasePublished.getRealname());
        paramsMap.put(Params.mobile, purchasePublished.getMobile());
        paramsMap.put(Params.content, purchasePublished.getContent());
        paramsMap.put(Params.unit, purchasePublished.getUnit());
        paramsMap.put(Params.lng, purchasePublished.getLng());
        paramsMap.put(Params.lat, purchasePublished.getLat());
        paramsMap.put(Params.minsell, purchasePublished.getMinsell());
        paramsMap.put(Params.images, purchasePublished.getImages());
        paramsMap.put(Params.shuai, purchasePublished.getShuai());
        paramsMap.put(Params.money, purchasePublished.getMoney());
        //1.4 新增参数  发布到商机
        paramsMap.put(Params.searchtxt, purchasePublished.getSearchtxt());
        paramsMap.put(Params.histroySupply, purchasePublished.getHistroySupply());
        paramsMap.put(Params.specifications, purchasePublished.getSpecifications());
        return getBaseParams(false, paramsMap);
    }

    public static Map<String, String> publishedSupplyRecordDelete(String number) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.number, number);
        return paramsMap;
    }

    public static Map<String, String> shipperChooseCar(String caruserid, String goodsId) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.caruserid, caruserid);
        paramsMap.put(Params.goodsId, goodsId);
        return paramsMap;
    }

    public static Map<String, String> getMyPriceParams(int type, String cursor, String offset) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.type, type + "");
        paramsMap.put(Params.cursor, cursor);
        paramsMap.put(Params.offset, offset);
        return paramsMap;
    }


    public static Map<String, String> getModifyPriceParams(String id, String money, String type) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.money, money);
        paramsMap.put(Params.type, type);
        return paramsMap;
    }

    public static Map<String, String> getCancelPriceParams(String id, String type) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.id, id);
        paramsMap.put(Params.type, type);
        return paramsMap;
    }

    public static Map<String, String> getSpecificationParams(String bigpid, String pid, String catid) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.bigpid, bigpid);
        paramsMap.put(Params.pid, pid);
        paramsMap.put(Params.catid, catid);
        return paramsMap;
    }

    public static Map<String, String> getAuditRealnameParams(String realname, String idnum) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.realname, realname);
        paramsMap.put(Params.idnum, idnum);
        return paramsMap;
    }

    public static Map<String, String> getBrandScopeApplyParams(BrandScope brandScope) {
        Map<String, String> paramsMap = getHeaderParams();
        paramsMap.put(Params.name, brandScope.getName());
        paramsMap.put(Params.shopName, brandScope.getShopName());
        paramsMap.put(Params.city, brandScope.getCity());
        paramsMap.put(Params.detailAddress, brandScope.getDetailAddress());
        paramsMap.put(Params.receiveTime, brandScope.getReceiveGoodsTime());
        return paramsMap;
    }
}
